<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link href='http://fonts.googleapis.com/css?family=Arvo' rel='stylesheet' type='text/css'>
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="Scripts/jquery-1.9.0.js"></script>
<script type="text/javascript" src="Scripts/jquery.validate.min.js"></script>
<script type="text/javascript">
 
$.validator.setDefaults(
{
	//submitHandler: function() { alert("submitted!"); }
});

$().ready(function() 
{
	$("#FormText").validate({
		rules: 
		{
			testo: 
			{
				required: true,
				minlength: 2
			}
		},
		messages:
		{
			testo:
			{
				required:"Scrivere un commento non vuoto",
				minlength: "Commento troppo corto"
			}
		}
	});
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Commenta</title>
</head>
<body>
    <form name="bacheca" method="post" action="BachecaServlet">
      <input type="hidden" name="username" value="<%=request.getAttribute("mittente") %>">
      <input type="hidden" name="nome" value="<%=request.getAttribute("nomeId") %>">
      <input type="hidden" name="cognome" value="<%=request.getAttribute("cognomeId") %>">
   </form>
   <form name="notifiche" method="post" action="NotificheServlet">
      <input type="hidden" name="username" value="<%=request.getAttribute("mittente") %>">
      <input type="hidden" name="nome" value="<%=request.getAttribute("nomeId") %>">
      <input type="hidden" name="cognome" value="<%=request.getAttribute("cognomeId") %>">
   </form>
    <form name="ricerca" method="post" action="Ricerca.jsp">
      <input type="hidden" name="id" value="<%=request.getAttribute("mittente") %>">
      <input type="hidden" name="nome" value="<%=request.getAttribute("nomeId") %>">
      <input type="hidden" name="cognome" value="<%=request.getAttribute("cognomeId") %>">
   </form>
   <div id="menu-wrapper">
		<div id="menu">
			<ul>
				<li><a href="javascript:document.bacheca.submit()">Bacheca</a></li>
      			<li><a href="javascript:document.notifiche.submit()">Notifiche</a></li>
      			<li><a href="MostraMioProfiloServlet?id=<%= request.getParameter("mittente") %>"><%= request.getParameter("nomeId") %><%= request.getParameter("cognomeId") %></a></li>
      			<li><a href="javascript:document.ricerca.submit()">Ricerca</a></li>
      			<li><a href="LogoutServlet?username=<%= request.getParameter("mittente")%>&user=utente">Logout</a></li>
      		</ul>
      	</div>
   </div>
	<div id="page">
		<div id="page-bgtop">
			<div id="page-bgbtm">
				<div id="content">
					<div class="post">
						<h2 class="title">Commenta</h2>
						<div class="entry">  
							<form name="FormText" id="FormText" method="post" action="CommentaProfiloServlet">
							   <p><textarea rows="5" cols="50" name="testo" id="testo">Inserire il commento</textarea></p>
							   <input type="hidden" name="idMsg" value="<%= request.getParameter("idMsg")%>">
							   <input type="hidden" name="progressivo" value="<%= request.getParameter("progressivo")%>">
							   <input type="hidden" name="mittente" value="<%= request.getParameter("mittente")%>">
							   <input type="hidden" name="destinatario" value="<%= request.getParameter("destinatario")%>">
							   <input type="hidden" name="amico" value="<%= request.getParameter("amico")%>">
							   <input type="hidden" name="nomeId" value="<%= request.getParameter("nomeId")%>">
							   <input type="hidden" name="cognomeId" value="<%= request.getParameter("cognomeId")%>">
							   <p><input type="submit" value="Commenta"></p>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>